import request from "@/utils/request";

// 选手列表接口
export function listPlayer(query) {
  return request({
    url: "/player/list",
    method: "get",
    params: query,
  });
}

// 新增选手接口
export function addPlayer(data) {
  return request({
    url: "/player/add",
    method: "post",
    data: data,
  });
}

// 修改选手接口
export function updatePlayer(data) {
  return request({
    url: "/player/edit",
    method: "post",
    data: data,
  });
}

// 删除选手接口
export function removePlayer(id) {
  return request({
    url: "/player/remove",
    method: "post",
    data: {
      id,
    },
  });
}

// 获取选手详情
export function getPlayer(id) {
  return request({
    url: "/player/info",
    method: "get",
    params: { id },
  });
}

// 批量导入自定义值
export function importCustomValues(data) {
  return request({
    url: "/player/import-custom-values",
    method: "post",
    data: data,
  });
}

// 淘汰选手
export function eliminatePlayer(playerId) {
  return request({
    url: "/player/eliminate",
    method: "post",
    params: { playerId },
  });
}

// 新增选手介绍接口
export function addPlayerIntroduce(data) {
  return request({
    url: "/playerIntroduce/add",
    method: "post",
    data: data,
  });
}

// 删除选手介绍接口
export function deletePlayerIntroduce(id) {
  return request({
    url: "/playerIntroduce/delete",
    method: "post",
    data: { id },
  });
}

// 获取选手介绍列表接口
export function listPlayerIntroduce(query) {
  return request({
    url: "/playerIntroduce/list",
    method: "get",
    params: query,
  });
}

// 新增选手介绍评价
export function addPlayerIntroduceComment(data) {
  return request({
    url: "/playerIntroduceComments/add",
    method: "post",
    data: data,
  });
}

// 获取选手介绍评价列表
export function listPlayerIntroduceComment(query) {
  return request({
    url: "/playerIntroduceComments/list",
    method: "get",
    params: query,
  });
}

// 获取选手介绍评价详情
export function getPlayerIntroduceComment(id) {
  return request({
    url: "/playerIntroduceComments/selectOne",
    method: "get",
    params: { id },
  });
}
